<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\facade\Route;

/*设置路由容错miss*/
Route::miss('public/miss');

/*首页访问路由*/
Route::get('/', 'index');
/*待办任务*/
Route::get('task','index/index/task');
Route::get('onloadTask', 'index/Task/onloadTask');
Route::get('loadTask', 'index/Task/loadTask');
/*下载app*/
Route::get('DownloadApp', 'index/index/DownloadApp');

/*公共路由|登录--*/
Route::post('checklogin','index/index/Login')->middleware(['Check']);
Route::get('login/:hint','index/index/showLogin');

/*公共路由|注册*/
Route::get('user/register', 'index/index/showRegister');
Route::post('user/registerThis', 'index/index/registerThis');

/*公共路由|验证码*/
Route::get('getcode/:timestamp', 'index/code/showCode');
Route::post('checkcode', 'index/code/checkCode');

/*README*/
Route::get('readme', 'index/index/readme');
/*最火的照片*/
Route::get('selectFirstImage', 'index/Image/selectFirstImage');


Route::get("parseMarkdown","index/Markdown/parseMarkdown");
/*管理员页面路由*/
Route::group('admin',function (){
    Route::get('/', 'admin/index/index');
    Route::get('main','admin/index/index');
    Route::get('exit','admin/index/exitLogin');
});

/*游客模式*/
Route::get("visitor","member/Visitor/index");

/*普通用户路由*/
Route::group('user',function (){
    /*客户端首页*/
    Route::get('/', 'member/index/index');
    /*传入类显示首页*/
    Route::get('class/:className', 'member/index/indexByClass');
    /*用户上传图片文件*/
    Route::get('upload', 'member/index/showUpload');
    Route::post('uploadThis', 'member/upload/uploadImage');
    /*用户个人中心*/
    Route::get("personal", "member/Index/showPersonal");
    /*用户VIP*/
    Route::get("vip", "member/Index/showVip");
    /*用户收藏*/
    Route::get("collect", "member/Index/showCollect");
    /*用户关注*/
    Route::get("attention", "member/Index/showAttention");
    /*历史记录*/
    Route::get("history", "member/Index/showHistory");
    /*图片详情*/
    Route::get("details/:md5", "member/Index/showDetails");
    /*评论图片*/
    Route::get("review/:md5","member/Index/reviewThis");
    /*搜索结果*/
    Route::get('search','member/index/showSearch');
    /*用户退出*/
    Route::get('exit','member/index/exitLogin');
    /*删除图片（软删除）*/
    Route::get('delete/:md5','member/index/deleteImage');
    /*硬删除（清空回收站）*/
    Route::get("deleteAll", "member/Upload/deleteImageAll");
    /*恢复*/
    Route::get('recover/:md5','member/index/recoverImage');
    Route::get('showImage/:md5','member/index/showImage');
    Route::get('hiddenImage/:md5','member/index/hiddenImage');
    /*图片信息与管理*/
    Route::get("likeIt","member/index/likeIt");
    Route::get("cancelLikeIt","member/index/cancelLikeIt");
    /*图片信息与管理*/
    /*我的博客*/
});

Route::group("blog",function (){
    Route::get("/:name","blog/Blog/showBlog");
    Route::get("details/:name/:detailId","blog/Blog/showBlogDetails");
});




/*----------工具路由---------*/
/*查询名字是否可用*/
Route::get("registerCheckName","index/member/registerCheckName");
/*查询邮箱是否可用*/
Route::get("registerCheckEmail/:email/:organization/:type","index/member/registerCheckEmail");

/*----缩略图片-后期直接使用函数----*/
Route::get("image/:name/:type", "index/Image/imageToThumb");

/*测试路由*/



Route::group('test', function (){
    Route::get('/', 'test/test/index');
    /*测试钩子*/
    Route::get('hook', 'test/HookTest/testhook');
    /*测试加密解密*/
    Route::get('ras', 'test/Demo/index');
    Route::get("data", "admin/Admin/selectAll");
    Route::get("memberpassword/:account", "member/Member/selectPassword");
    Route::get("password/:name", "admin/Admin/selectPassword");
    Route::get("data", "test/Test/index");
    Route::get("register", "test/test/index");
    Route::get("time", "index/Member/testTime");
    Route::get("registerCheckName/:nickname", "test/Test/registerCheckName");
    Route::get("testValidate", "test/Test/testValidate");
    Route::get("upload", "test/Test/testShowUpload");
    Route::post("uploadThis", "test/Test/uploadImage");
    Route::get("addImage", "test/Test/testAddImage");
    Route::get("image", "test/Test/selectImageAll");
    Route::get("api", "test/Test/selectClassAll");
    Route::get("imagebyid/:md5", "test/Test/selectImageByMd5");
    Route::get("qqLogin", "index/QLogin/qqLogin");
    Route::get("delete", "member/Upload/deleteImageAll");
    Route::get("selectlike", "test/Test/selectLike");
    Route::get("select1/:id", "member/index/reviewMsg");

});

return [

];
